package data.obj;

public class CombatResult
{
	int hit = 0;
	int endurance = 0;
	CriticalResult criticalResult = new CriticalResult();

	public CombatResult()
	{

	}

	public CombatResult(int hit, CriticalResult criticalResult)
	{
		super();
		this.hit = hit;
		this.criticalResult = criticalResult;
	}

	public int getHit()
	{
		return hit;
	}

	public void setHit(int hit)
	{
		this.hit = hit;
	}

	public CriticalResult getCriticalResult()
	{
		return criticalResult;
	}

	public void setCriticalResult(CriticalResult criticalResult)
	{
		this.criticalResult = criticalResult;
	}


	@Override
    public String toString()
    {
	    return "CombatResult [hit=" + hit + ", endurance=" + endurance + ", criticalResult=" + criticalResult + "]";
    }

	public int getEndurance()
	{
		return endurance;
	}

	public void setEndurance(int endurance)
	{
		this.endurance = endurance;
	}

	public void add(CombatResult cRes)
    {
	    hit=hit+cRes.hit;
	    hit=hit+cRes.criticalResult.hit;
	    criticalResult.hitRound=criticalResult.hitRound+cRes.criticalResult.hitRound;
	    criticalResult.penalty.addAll(cRes.criticalResult.penalty);
	    criticalResult.mustParryRounds=criticalResult.mustParryRounds+cRes.criticalResult.mustParryRounds;
	    criticalResult.stunnedRounds=criticalResult.stunnedRounds+cRes.criticalResult.stunnedRounds;
	    criticalResult.unableToParry=criticalResult.unableToParry+cRes.criticalResult.unableToParry;
	    criticalResult.death=criticalResult.death||cRes.criticalResult.death;
	    
    }

}
